<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of content_model
 *
 * @author phamtruong
 */
class video_model extends CI_Model {

    //put your code here
    public function __construct() {
        parent::__construct();
    }

    //select imformation at table article with id = avalible
    public function video($n) {
//        $this->db->select("*");
        $query = $this->db->query("select v.title,v.link, v.comment_number,v.description, d.created_date ,m.fullname
                from video v, video_discussion d, member m
                where d.video_id = v.id and v.id='$n' and v.member_id=m.id");
        return $query->result_array();
    }



//    //get content with lastest version
//    public function get_content($new_version) {
//        $query = $this->db->query("SELECT  `content` FROM  `article_version` WHERE  `version` = $new_version");
//        return $query->result_array();
//    }
//
//    //get imformation member create article from contributor_id older version
//    public function member_create($id_article) {
//        $query = $this->db->query("
//            select m.fullname
//            from member m, article_version v
//            where m.id=v.contributor_id 
//            AND v.version=(select min(version) from article_version where v.article_id=$id_article)
//                 ");
//        return $query->result_array();
//    }
//
//    // get date created article by oder version
//    public function get_date($id_article) {
//        $query = $this->db->query("
//            select v.modified_date
//            from article a, article_version v
//            where a.id=v.article_id 
//            AND v.version=(select min(version) from article_version where v.article_id= $id_article)
//            ");
//        return $query->result_array();
//    }
//    //get contributor
//
//    public function get_contributor($id_article){
//        $query= $this->db->query("
//            select m.fullname
//            from member m, article_version v
//            where m.id=v.contributor_id 
//            AND v.version !=(select min(version) from article_version where v.article_id=$id_article)
//            ");
//        return $query->result_array();
//    }
}

/* End of file content_model.php */
/* Location: ./application/models/content_model.php */